<?php
/*
 * @Description    : SignFailAddJob
 * @Author         : QianLong
 * @Date           : 2023-06-06 18:21:59
 * @LastEditors    : QianLong
 * @Site           : http://www.21ds.cn
 * @LastEditTime   : 2023-06-06 18:26:44
 */

declare(strict_types=1);

namespace App\Job;

use Hyperf\AsyncQueue\Job;

class SignFailAddJob extends Job
{
    public $params;

    public function __construct($params)
    {
        $this->params = $params;
    }

    public function handle()
    {
        if (is_array($this->params)) {
            $this->params['time'] = time();
            $this->params['_id'] = createId();
            $collection = mongodb2()->selectCollection('sign_fail_log_' . $this->params['uid']);
            $collection->insertOne($this->params);
        }
        unset( $this->params);
    }
}
